<?php  

	include("bd/conexao/config.php"); // Arquivo de configuração MySQL		 

	if(isset($_GET["id"])) {

		$id = base64_decode($_GET["id"]);
	  
	    if(is_numeric($id)) {    

	        /*$sql = "SELECT * FROM repertorio" .
				   " INNER JOIN tipo_link ON repertorio.tipo_url_link = tipo_link.id" .
				   " WHERE repertorio.id= '" . $_GET["id"] . "' AND repertorio.ativo = 1 AND tipo_link.ativo = 1" ;  */         			   	  	

			$sql = "SELECT * from musicas where  id='" . $id . "'";

			$query   = mysql_query($sql); 				// Consulta letra selecionada			
			while($row  = mysql_fetch_array($query)) { // Retorna a letra selecionada						
		
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>	<?php echo $row['artista'] . " - " . $row['nome_musica']; ?> </title>

		<!-- CSS -->	
		<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
		<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">		
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,700,300&amp;subset=latin,cyrillic-ext,vietnamese,cyrillic" rel="stylesheet" type="text/css">

	    <!-- SCRIPTS -->    
		<!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> 
		<script src="https://code.jquery.com/jquery.js"></script> 	

		<!-- Include all compiled plugins (below), or include individual files as needed -->
	    <script src="js/bootstrap.min.js"></script>	   

	    <script>

	    	$(document).ready(function() { 	

	    	    $('#img-link-video').tooltip();
	    	    //$('#img-print').tooltip();	    	 
       	        $('#btnVoltarMusica').tooltip();

	    	    $('#btnVoltarMusica').click(function() {

				    $(window.document.location).attr('href','musica.php');

				});

	    	
	    	});

	    </script>

	</head>

	<body>

		<div class="container">

			<button type="button" class="btn glyphicon glyphicon-circle-arrow-left" id="btnVoltarMusica" data-toggle='tooltip' data-placement='right' title='Voltar para Músicas'></button>

			<div id="resultado"> 

				<?php							

					/*$sql = "SELECT * from tipo_link where id= '" . $row['tipo_url_link'] ."' and ATIVO = 1";
                  	$query = mysql_query($sql);

                  	$resultado = mysql_fetch_array($query); 
                  	*/
   			
   					echo "<h2>" . $row['artista']      .   "</h2>";
   					echo "<h4>" . $row['nome_musica']  .   "</h4> <br /> ";   					
   					echo "<p> <a href='javascript:print();'> <img src='img/printer.png' border='0' id='img-print' data-toggle='tooltip' data-placement='bottom' title='Imprimir'> </a> ";
					echo "<a href='{$row['link_video']}' target='_blank'> <img src='img/audio-video3.png' border='0' id='img-link-video' data-toggle='tooltip' data-placement='bottom' title='Link Vídeo'></a>" . " </p> <br />";					
   					echo "<p class='letra'>"  . nl2br($row['letra']) . "</p>";     					   				
   					
				?>	

			</div>

		</div>

	<?php	

			}
		}		

	} 

	?>

	</body>

</html>